<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      body {
        height: 3000px;
      }
    </style>
  </head>
  <body>
    <script>
      document.addEventListener("click", function (e) {
        //client鼠标在可视区域的x和y坐标
        console.log(e.clientX);
        console.log(e.clientY);
        console.log("-----------------------------------------");
        //page相对于页面文档的x和y坐标
        console.log(e.pageX);
        console.log(e.pageY);
      });
      console.log();
    </script>
  </body>
</html>
